<?php
defined('IN_ADMIN') or exit('No permission resources.');
$show_validator = true;
include $this->admin_tpl('header');
?>
<script type="text/javascript">
//<!--
$(function(){
	
	$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
	$("#user").formValidator({onshow:"请输入用户名",onfocus:"用户名不能为空"})
		.inputValidator({min:1,max:64,onerror:"名称不能为空"})
		.regexValidator({regexp:"^[A-Za-z0-9]+$",onerror:"用户名只能为字母和数字"});
	$("#pwd").formValidator({onshow:"请输入密码",onfocus:"密码不能为空"})
		.inputValidator({min:1,max:64,onerror:"密码不能为空"});		
	$("#name").formValidator({onshow:"请输入姓名",onfocus:"姓名不能为空"})
		.inputValidator({min:1,max:64,onerror:"姓名不能为空"});		
})
function cpwd(length){
	length = length || 8;  
	var source = "abcdefghzklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789=~@#$%^*?";  
	var s = "";  
	//console.log(Math.ceil(Math.random()*1000)%source.length);
	for(var i = 0;i < length; i++)  {  
		s += source.charAt(Math.ceil(Math.random()*10000)%source.length);  
	}
	$('#pwd').val(s);
	//return s;  
}
//-->
</script>
<div class="pad_10">
<div class="common-form">
<form name="myform" action="?m=<?php echo ROUTE_M;?>&c=<?php echo ROUTE_C;?>&a=add" method="post" id="myform">
<table width="100%" class="table_form contentWrap">
<tr>
<td  width="80">用户名</td> 
<td><input type="text" name="info[user]" value="" class="input-text" id="user"></input></td>
</tr> 
<tr>
  <td>密码</td> 
  <td><input type="text" name="info[pwd]" value="" class="input-text" id="pwd"></input><a href="javascript:cpwd();">生成</a></td>
</tr>
<tr>
  <td>姓名</td> 
  <td><input type="text" name="info[name]" value="" class="input-text" id="name"></input></td>
</tr>
<tr>
  <td>项目</td> 
  <td><input type="text" name="info[proj]" value="" class="input-text" id="proj"></input></td>
</tr>
<tr>
  <td>职位</td> 
  <td><input type="text" name="info[pos]" value="" class="input-text" id="pos"></input></td>
</tr>
<tr>
  <td>权限</td> 
  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <?php foreach($group_list as $sid=>$gs){?>
    <tr>
      <td><?php echo $svn_list[$sid];?></td>
      <td><?php foreach($gs as $g){?><label><input name="groups[]" type="checkbox" id="groups_<?php echo $g['id'] ;?>" value="<?php echo $g['id'];?>">
    <?php echo $g['name'];?> </label><?php } ?></td>
    </tr>
    <?php } ?>
  </table>
  
  </td>
</tr>


 
</table>

    <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog" id="dosubmit">
</form>

</div></div>
</body>
</html>



